﻿using System.ServiceModel;
using ChatApp.Service.Model;
using System.Collections.Generic;

namespace ChatApp.Service
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract(CallbackContract = typeof(IClientCallback))]
    public interface IChatAppService
    {
        #region User

        [OperationContract]
        User LoginUser(string userName, string password);

        [OperationContract]
        void CreateUser(User user);

        [OperationContract]
        bool IsDuplicateUser(string userName);

        [OperationContract]
        User RetrieveUserByUserName(string userName);

        #endregion

        #region AddFriend

        [OperationContract]
        int CreateAddFriend(AddFriend addFriend);

        [OperationContract]
        List<AddFriend> RetrieveAllAddFriend(string userName);

        [OperationContract]
        bool IsDuplicateUserAdd(string userName, string userNameAdd);

        #endregion

        #region Message

        [OperationContract]
        int SendMessage(int idRoom, string tenRoom, bool laChatRoom, string userNameSend, string text, List<string> listUserNameReceive);

        #endregion

        [OperationContract]
        void RegisterClient(string userName);
    }

    public interface IClientCallback
    {
        [OperationContract]
        void RefreshContentChat(int idRoom, string tenRoom, string userNameSend, string textChat, bool laChatRoom);
    } 
}
